{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox-title">
        <h5>闯关试题</h5>
    </div>
    <div class="ibox-content layui-form">
        <div class="layui-row layui-col-space10 layui-form-item ">
            <input type="hidden" name="id" value="{$info['rs_id']}">
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">问题名字：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_name" value="{$info['rs_name']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择题A：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_a" value="{$info['rs_a']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择题B：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_b" value="{$info['rs_b']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择题C：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_c" value="{$info['rs_c']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择题D：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_d" value="{$info['rs_d']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">正确答案：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_answer" value="{$info['rs_answer']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">题目难度系数：</label>
                <div class="layui-input-block">
                    <input type="text" name="rs_difficult" value="{$info['rs_difficult']}" lay-verify="required" class="layui-input ">
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择类型：</label>
                <div class="layui-input-block">
                    <select name="rs_type">
                        <option value="1" {if $info['rs_type']==1}selected{/if}>认读能力</option>
                        <option value="2" {if $info['rs_type']==2}selected{/if}>记诵能力</option>
                        <option value="3" {if $info['rs_type']==3}selected{/if}>理解能力</option>
                        <option value="4" {if $info['rs_type']==4}selected{/if}>鉴赏能力</option>
                        <option value="5" {if $info['rs_type']==5}selected{/if}>活用能力</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择书名：</label>
                <div class="layui-input-block">
                    <select name="rs_book_id">
                    {foreach name="info1" item="v"}
                    <option value="{$v.rb_id}" {if $v['rb_id']==$info['rs_book_id']}selected{/if}>{$v.rb_name}</option>
                    {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">选择关卡：</label>
                <div class="layui-input-block">
                    <select name="rs_game_id">
                    {foreach name="info2" item="vv"}
                    <option value="{$vv.rg_id}" {if $vv['rg_id']==$info['rs_game_id']}selected{/if}>{$vv.rg_name}</option>
                    {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <label class="layui-form-label">备注内容：</label>
                <div class="layui-input-block">
                    <textarea name="rs_remark" style="height:120px;width:580px">{$info['rs_remark']}</textarea>
                </div>
            </div>

            <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('update')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('customs/index')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>
</body>
</html>